﻿<?
include("../Comm/Manage_err.php");
include("../Comm/Conn.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Netsys网站管理系统</title>
<link href="../Style/Css.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function CheckAll(form)  
{
  for (var i=0;i<form.elements.length;i++)    
  {
    var e = form.elements[i];
    if (e.name != 'chkall')
	e.checked = form.chkall.checked; 
  }
}
function CheckOne()
{   
	var   flag=false;   
	var   NetsysID=document.getElementsByName("NetsysID");   
	for(i=0;i<NetsysID.length;i++)
	{   
		if (NetsysID(i).checked)
		{   
			flag=true;   
			break;   
		}   
	}   
	if (!flag)   
	{     
	  alert('请至少选择一条记录！');
	  return false;   
	}      
}   
</script>
</head>
<body>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="10"></td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="right_tittle">
  <tr>
    <td width="3"><img src="../images/r1.jpg" width="10" height="33" /></td>
    <td><img src="../images/current.jpg" width="9" height="9" /> 当前位置 &gt;&gt; 管理员管理
      | 管理员列表</td>
    <td width="10" align="right"><img src="../images/r3.jpg" width="10" height="33" /></td>
  </tr>
</table>
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="2" class="right_con">
    <tr>
      <td height="490" align="center" valign="top" bgcolor="#FFFFFF">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="5"></td>
        </tr>
      </table>
      <br />
    <form name="Search" action="" method="post">
    <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CDD8DF" class="table_all" >
        <tr>
          <td height="40" align="left" bgcolor="#FFFFFF" style="padding-left:10px;">请输入关键字：
          <input type="text" name="KeyWord" id="KeyWord" />
          <input type="submit" name="button" id="button" value=" 开始检索 " /></td>
        </tr>
    </table>
    </form>
    <form name="MyForm" action="Netsys_Del.php" method="post">
    <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CDD8DF" class="table_all" >
      <tr class="table_tittle">
        <td bgcolor="#FFFFFF">编号</td>
        <td bgcolor="#FFFFFF">管理员登录名</td>
        <td bgcolor="#FFFFFF">角色权限</td>
        <td bgcolor="#FFFFFF">操作</td>
        <td bgcolor="#FFFFFF">选择</td>
      </tr>
        <?   if($_POST['KeyWord']){
		     $SQL="SELECT * FROM Netsys_Manage where NetsysName like '%$_POST[KeyWord]%' order by NetsysID desc";
		     }else{
             $SQL="SELECT * FROM Netsys_Manage order by NetsysID desc";
			 }
             $query=mysql_query($SQL);
             while($row=mysql_fetch_array($query)){
        ?>
      <tr>
        <td bgcolor="#FFFFFF"><? echo $row['NetsysID'];?></td>
        <td bgcolor="#FFFFFF"><? echo $row['NetsysName'];?></td>
        <td bgcolor="#FFFFFF"><? echo $row['NetsyClass'];?></td>
        <td bgcolor="#FFFFFF"><a href="Netsys_<? if($_SESSION["NetsyClass"]=="管理员"){echo "Edit"; }else{echo "Pass";}?>.php?NetsysID=<? echo $row['NetsysID'];?>">修改</a></td>
        <td bgcolor="#FFFFFF"><input type="checkbox" name="NetsysID" value="<? echo  $row['NetsysID'];?>" style="border:0px;"></td>
      </tr>
<?
  }
?> 
    </table>
    <table width="200" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="35" align="center">
        <input type="checkbox" name="chkall" id="chkall" onClick="CheckAll(this.form);" style="border:0px;" />
        全选
        </td>
        <td align="center">
        <input type="image" src="../images/del_all.jpg" onClick="return CheckOne();" style="width:94px; height:20px; border:0px;" />
        </td>
      </tr>
    </table>
    <table width="98%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>
        </td>
      </tr>
    </table>
   </form>
   </td>
  </tr>
</table>
</body>
</html>